package sample.testBitmapHit
{
	import org.abc.utils.BitmapHitTestPlus;
	import flash.display.Bitmap;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.filters.GlowFilter;

	/**
	 * @describe  	...
	 * @author  	Mr.zheng
	 * @website 	http://blog.sina.com.cn/zihua2007
	 * @time		2011-8-23 13:51
	 */
	public class TestBitmapHit extends Sprite
	{
		private var _c:Shape;
		private var _c2:Shape;
		private var _c3:Bitmap;

		public function TestBitmapHit()
		{
			_c=new Shape();
			_c.graphics.clear();
			_c.graphics.beginFill(0x000000, 1);
			_c.graphics.drawCircle(0, 0, 10);
			_c.graphics.endFill();
			_c.x=_c.y=100;
			addChild(_c);

			_c3=new Bitmap(new BM());
			addChild(_c3);
			_c3.x=200;


			_c2=new Shape();
			_c2.graphics.clear();
			_c2.graphics.beginFill(0x000000, 1);
			_c2.graphics.drawCircle(0, 0, 20);
			_c2.graphics.endFill();
			_c2.x=_c2.y=300;
			addChild(_c2);

			this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
		}

		private function onEnterFrame(e:Event):void
		{
			_c2.x=mouseX;
			_c2.y=mouseY;

			var isHit:Boolean;
			isHit=BitmapHitTestPlus.complexHitTestObject(_c3, _c2);
			if (isHit)
			{
				_c3.filters=_c2.filters=[new GlowFilter()];
			}
			else
			{
				_c3.filters=_c2.filters=[];
			}

		}
	/* public function */

	/* override function */

	/* private function */
	}

}
